<?php 
/**
 * 产品中心模板
 */
if(!defined('EMLOG_ROOT')) {exit('error!');}
global $CACHE;
$sort_cache = $CACHE->readCache('sort');
$parent_sid_arr = array(1,5,9,13,17,21);
?>
<link rel="stylesheet" href="<?php echo TEMPLATE_URL; ?>css/content.css">
<div class="bannar_div">
    <div class="am-container-1 wp">
        <div class="right toppic-progress">
            <span><a href="<?php echo BLOG_URL; ?>" class="w-white">首页</a></span>
            <i class=" am-icon-arrow-circle-right w-white"></i>
            <span><a href="<?php echo BLOG_URL; ?>?sort=1" class="w-white">产品中心</a></span>
            <?php
            $sort_id = intval($_GET['sort']);
            if(!isset($sort_cache[$sort_id]['children'])):
                $sort_id = $sort_cache[$sort_id]['pid'];
            endif;
            if(in_array(intval($sort_id),$parent_sid_arr)):
            ?>
            <i class=" am-icon-arrow-circle-right w-white"></i>
                <span><a href="<?php echo BLOG_URL; ?>?sort=<?php echo $sort_id;?>" class="w-white"><?php echo $sort_cache[intval($sort_id)]['sortname']?></a></span>
            <?php
            endif;
            ?>
            <?php
            if(isset($sort_cache[intval($_GET['sort'])]) && !in_array(intval($_GET['sort']),$parent_sid_arr)):
            ?>
            <i class=" am-icon-arrow-circle-right w-white"></i>
            <span><?php echo $sort_cache[intval($_GET['sort'])]['sortname']?></span>
            <?php
            endif;
            ?>
        </div>
    </div>
</div>
<div class="cate_body_div" style="min-height:500px;">
    <div class="cate_div_content">
        <?php
        $p_sort = in_array(intval($_GET['sort']),$parent_sid_arr) ? intval($_GET['sort']) : $sort_cache[intval($_GET['sort'])]['pid'];
        ?>
        <ul class="cate_div_content_ul">
            <li>
                <a <?php if(intval($p_sort) == 1):?>class="curr"<?php endif;?> href="<?php echo BLOG_URL; ?>?sort=1" title="移动端推广">移动端推广</a>
            </li>
            <li>
                <a <?php if(intval($p_sort) == 5):?>class="curr"<?php endif;?> href="<?php echo BLOG_URL; ?>?sort=5" title="电脑端推广">电脑端推广</a>
            </li>
            <li>
                <a <?php if(intval($p_sort) == 9):?>class="curr"<?php endif;?> href="<?php echo BLOG_URL; ?>?sort=9" title="电商推广">电商推广</a>
            </li>
            <li>
                <a <?php if(intval($p_sort) == 13):?>class="curr"<?php endif;?> href="<?php echo BLOG_URL; ?>?sort=13" title="大数据分析">大数据分析</a>
            </li>
            <li>
                <a <?php if(intval($p_sort) == 17):?>class="curr"<?php endif;?> href="<?php echo BLOG_URL; ?>?sort=17" title="百度seo软件">百度seo软件</a>
            </li>
            <li>
                <a <?php if(intval($p_sort) == 21):?>class="curr"<?php endif;?> href="<?php echo BLOG_URL; ?>?sort=21" title="微信营销">微信营销</a>
            </li>
        </ul>
    </div>
    <div class="body_div_content">
        <?php
        $sort_id = intval($_GET['sort']);
        if(!isset($sort_cache[$sort_id]['children'])):
            $sort_id = $sort_cache[$sort_id]['pid'];
        endif;
        if($sort_id && isset($sort_cache[$sort_id]['children'])):
        ?>
        <ul class="am-nav am-nav-tabs am-nav-justify">
            <li <?php if(in_array(intval($_GET['sort']),$parent_sid_arr)):?>class="am-active"<?php endif;?>>
                <a href="<?php echo Url::sort($p_sort); ?>">全部</a>
            </li>
            <?php
            foreach($sort_cache[$sort_id]['children'] as $v):
            ?>
            <li <?php if(intval($_GET['sort']) == $sort_cache[$v]['sid']):?>class="am-active"<?php endif;?>>
                <a href="<?php echo Url::sort($sort_cache[$v]['sid']); ?>"><?php echo $sort_cache[$v]['sortname'];?></a>
            </li>
            <?php
            endforeach;
            ?>
        </ul>
        <?php
        endif;
        ?>
        <div class="_blank10" style="height:20px;"></div>
        <ul class="am-list">
        <?php
        if (!empty($logs)):
            foreach($logs as $value):
        ?>
            <li style="position:relative">
                <span class="am-badge" style="position:absolute;right:10px;top:13px;"><?php echo gmdate('Y-n-j', $value['date']); ?></span>
                <?php topflg($value['top'], $value['sortop'], isset($sortid)?$sortid:''); ?><a href="<?php echo $value['log_url']; ?>"><?php echo $value['log_title']; ?></a></li>
                <?php
            endforeach;
        else:
            ?>
            <h2>未找到</h2>
            <p>抱歉，没有符合您查询条件的结果。</p>
        <?php endif;?>
        </ul>
        <div id="pagenavi" class="am-pagination">
            <?php echo $page_url;?>
        </div>
    </div>
</div>
<?php
 include View::getView('footer');
?>